<template>
	<view class="layer" v-if="isShow">
		<view class="layer_content">
			<view class="head_img">
				<!-- <view class="img"> -->
				<image class="img" :src="getAvatar()" mode="aspectFit"></image>
				<!-- </view> -->
				<image class="crown" src="../../../static/images/detail/huangguan.png" mode=""></image>
				<image class="icon_v" src="../../../static/images/detail/icon_V.png" mode=""></image>
			</view>
			<view class="text">
				{{ (userName || "匿名") + "已完成了实名认证，我们会为TA优先推荐认证用户哦！" }}
				
			</view>
			<view @click="toAuth" class="btn">
				立即认证，让TA看到我
			</view>
			<view class="mes">
				请先认证再留言
			</view>
		</view>
		<image @click="hideAuthAction" class="icon_close"  src="../../../static/images/detail/icon_close.png" mode=""></image>
	</view>
</template>

<script>
	export default {
		props:{
			isShow: Boolean,
			userName: String,
			avatar:String,
		},
		data() {
			return {
			}
		},
		methods:{
			getAvatar(){
				let avatarStr =  this.avatar || ""
				if  (avatarStr === "") {
					return  "http://static.kuaimayoupin.com/5814340611455953.png"
				} 
				return avatarStr
			},
			moveHandle(e){
				
			},
			hideAuthAction(){
				this.$emit("close")
			},
			toAuth(){
				this.$emit("close")
				uni.navigateTo({
					url:"/pageA/realName/realName"
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	* {
		box-sizing: border-box;
	}
	.layer {
		display: flex;
		flex-direction: column;
		align-items:center;
		justify-content: center;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
		background: rgba(0,0,0,0.4);
		.layer_content {
			width: 570rpx;
			height: 640rpx;
			border-radius: 12rpx;
			background-color: #fff;
			.head_img { 
				margin: 0 auto;
				margin-top: 114rpx;
				height: 160rpx;
				width: 160rpx;
				position: relative;
				
				.img {
					display: block;
					border-radius: 50%;
					overflow: hidden;
					width: 100%;
					height: 100%; 
				}
				.crown {
					position: absolute;
					top: -52rpx;
					left: 0rpx;
					margin: 0 auto;
					right: 0; 
					width: 92rpx;
					height: 56rpx; 
				}
				.icon_v {
					position: absolute;
					bottom: 0rpx;
					right: 6rpx;
					width: 34rpx;
					height: 32rpx;
				}
			}
			.text {
				padding: 32rpx 40rpx 46rpx 40rpx;
				line-height: 45rpx;
				font-size: 26rpx;
				color: #474A58;
				text-align: center;
			}
			.btn {
				width: 376rpx;
				margin: 0 auto;
				text-align: center;
				height: 72rpx;
				line-height: 72rpx;
				background: linear-gradient(135deg, #FC4F91 0%, #FD6CE6 100%);
				border-radius: 4rpx;
				font-size: 30rpx;
				font-weight: 500;
				color: #fff;
			}
			.mes {
				line-height: 45pux;
				font-size: 26rpx;
				color: #9DA2B5;
				text-align: center;
				margin-top: 20rpx;
			}
		}
		.icon_close {
			width: 54rpx;
			height: 112rpx;
			align-self: center;
		}
	}
</style>
